﻿using System;
using System.Windows;
using System.Windows.Controls;
using Gao.Poker.App.ViewModel;

namespace Gao.Poker.App.Store
{
    /// <summary>
    /// Interaction logic for SellHistoryView.xaml
    /// </summary>
    public partial class SellHistoryView : UserControl
    {
        public ConsumptionViewModel ViewModel { get; set; }
        public SellHistoryView()
        {
            InitializeComponent();
            ViewModel = new ConsumptionViewModel();
            //ViewModel.Message = OnMessage;
            DataContext = ViewModel;

            btnSearch.Click += Search_Click;
        }

        private void OnMessage(string obj)
        {
            MessageBox.Show(obj, "提示消息");
        }

        private void Search_Click(object sender, RoutedEventArgs e)
        {
            ViewModel.PageIndex = 0;
        }

        private void Pager_PageIndexChanging(int pageindex, EventArgs e)
        {
            ViewModel.PageIndex = pageindex;
        }
    }
}
